#include "includes/menu_item.h"
#include <string.h>


void menu_item_draw(const Menu_Item * item, int is_selected){
	if(is_selected){
		util_display_texture(item->texture_on, item->x, item->y, item->w, item->h);
	}
	else {
		util_display_texture(item->texture_off, item->x, item->y, item->w, item->h);
	}
}

void menu_item_texture_init(Menu_Item * item, const char* name){
	
	char path_off[300];
	char path_on[300];
	
	strcpy(path_off, "./images/menu/items/");
	strcat(path_off, name);
	strcpy(path_on, path_off);
	strcat(path_on, "_on.png");
	strcat(path_off, "_off.png");
	
	item->texture_off = util_load_texture(path_off);
	item->texture_on = util_load_texture(path_on);
}